<?php $model = 'CourseDetail'; 
if(isset($openDate)){
	$openDateArr = date_parse($openDate);
}else{
	$openDateArr = date_parse(date('Y-m-d H:i:s'));
}
if(isset($closeDate)){
	$closeDateArr = date_parse($closeDate);
}else{
	$closeDateArr = date_parse(date('Y-m-d H:i:s'));
}
if(!isset($address_flg)){
	$address_flg = 0;
}
?>
<div id="hiddenForm" <?php if($isAddSchedule == 0): ?>class="none-display" <?php endif; ?> >
	<input type="hidden" id="isAddSchedule" name="data[CourseDetail][isAddSchedule]" value="<?php echo $isAddSchedule; ?>"/>
	<h1 class="subTitle add">スケジュールを追加する</h1>
	<p class="shedule-text-hint">
		最初に開催される開催日時を追加することができます。<br/>
		こちらは必須ではありませんので、考え中の方はもう一度ボタンを押して進めてください。
	</p><br/><br/>
	<p class="text-align-center">
		<a href="javascript:void(0)" id="hiddenScheduleForm" >初回のスケジュールを登録しない</a>
	</p><br/><br/>
	<table class="scheduleForm">
		<tr>
			<td class="left"><label for="year">名前</label></td>
			<td>
				<dl>
					<dd><label for="year">開催日</label></dd>
					<dt>
						<?php echo $this->Form->year('CourseDetail', date('Y'), date('Y', strtotime("+3 year")),$openDateArr['year'] , array('empty' => FALSE, 'id' => 'year')) . '年';?>
						<?php echo $this->Form->month('CourseDetail', $openDateArr['month'], array('id' => 'month', 'monthNames' => FALSE, 'empty' => FALSE)) . '月';?>
						<?php echo $this->Form->day('CourseDetail', $openDateArr['day'], array('id' => 'day', 'empty' => FALSE)) . '日';?>
					</dt>
					<dd><label for="openHour">開催時間</label></dd>
					<dt>
						<?php echo $this->Form->hour('CourseDetail.openHour', true, $openDateArr['hour'], array('id' => 'openHour', 'empty' => FALSE)) ;?>
						:
						<?php echo $this->Form->minute('CourseDetail.openMinute', $openDateArr['minute'], array('id' => 'openMinute', 'empty' => FALSE));?>
						〜
						<?php echo $this->Form->hour('CourseDetail.closeHour', true, $closeDateArr['hour'], array('id' => 'closeHour', 'empty' => FALSE)) ;?>
						:
						<?php echo $this->Form->minute('CourseDetail.closeMinute', $closeDateArr['minute'], array('id' => 'closeMinute', 'empty' => FALSE));?>
					</dt>
					<dt>
					<div><?php echo $form->error('CourseDetail.opening_date', null, array('class'=>'error-message')); ?></div>
					<div><?php echo $form->error('CourseDetail.closing_date', null, array('class'=>'error-message')); ?></div>
					</dt>
				</dl>
			</td>
		</tr>
		<tr>
			<td class="left"><label for="area">開催場所<br/>キャッチコピー</label></td>
			<td>
				<dl>
					<dd><label for="area">エリア</label></dd>
					<dt>
						<?php echo $this->Form->select('CourseDetail.area', $areas, null, array('empty' => false, 'id' => 'area')); ?>
					</dt>
					<dd><label for="zip01">郵便番号</label></dd>
					<dt>
						<div class="formZip">
							<label for="zip01" class="zip01">〒</label>
							<?php echo $this->Form->text('CourseDetail.zip01', array('maxlength' => 3, 'size' => 3, 'label' => false, 'div' => false, 'id' => 'zip01', 'class' => 'required number text zip')) ?>
							&nbsp;-&nbsp;
							<?php echo $this->Form->text('CourseDetail.zip02', array('maxlength' => 4, 'size' => 4, 'label' => false, 'div' => false, 'id' => 'zip02', 'class' =>'required number text zip'));?>
						</div>
					</dt>
					<dd><label for="city">市区町村</label></dd>
					<dt>
						<?php echo $this->Form->input('CourseDetail.address01', array('label' => false,  'id' => 'city', 'class' => 'required text', 'div' => FALSE)) ?>
					</dt>
					<dd><label for="address">番地・建物名</label></dd>
					<dt>
						<?php echo $this->Form->input('CourseDetail.address02', array('label' => false, 'class' => 'required text', 'id' => 'address', 'div' => FALSE)) ?>
					</dt>
					<dd><label for="placeName">開催場所名</label></dd>
					<dt>
						<?php echo $this->Form->input('CourseDetail.place_name', array('label' => false, 'class' => 'address', 'id' => 'placeName', 'div' => FALSE)) ?>
					</dt>
					<dd>開催地公開設定</dd>
					<dt class="clear">
						<?php echo $this->Form->radio('CourseDetail.address_flg', array('1' => '&nbsp;全てのユーザに公開', '0' => '&nbsp;予約したユーザのみに公開'), array('label' => false, 'separator' => '&nbsp;&nbsp;', 'legend' => false, 'value' => $address_flg)) ;?>
					</dt>
				</dl>
			</td>
		</tr>
		<tr>
			<td class="left"><label for="attendTotal">参加内容詳細</label></td>
			<td>
				<dl>
					<dd><label for="attendTotal">最大参加人数</label></dd>
					<dt><?php echo $this->Form->input('CourseDetail.attend_total', array('label' => false, 'class' => 'required number text total', 'id' => 'attendTotal', 'div' => FALSE));?></dt>
					<dd><label for="price">参加費用</label></dd>
					<dt>
						<?php echo $this->Form->text('CourseDetail.price', array('label' => false, 'class' => 'required number text price', 'id' => 'price', 'div' => FALSE));?>&nbsp;円<br class="br-price" />
						<div><?php echo $form->error('CourseDetail.price', null, array('class'=>'error-message')); ?></div>
					</dt>
				</dl>
			</td>
		</tr>
		<tr>
			<td class="left"><label for="notice">その他 表記事項</label></td>
			<td>
				<?php echo $this->Form->textarea('CourseDetail.notice', array('type' => 'textarea','label' => false, 'rows' => 6, 'cols' => 50, 'id' => 'notice', 'class' => '')); ?>
			</td>
		</tr>
	</table>
</div>